package part_II;

import java.math.BigDecimal;
import java.math.BigInteger;
import temperature.*;
import environment.*;
import environment.borders.*;

/**
 * Deze klasse houdt het uit te voeren hoofdprogramma bij. 
 * Dit dient ter demonstratie van het project Project2-Associations.
 * 
 * @author Nathan Bekaert & Philippe de Potter de ten Broeck
 * @version 1.0
 */
public class Part_II {
 
	/**
	 * Deze methode is het uitvoerende programma van het project deel II. Deze dient
	 * 	ter demonstratie van de associaties 'vakje-begrenzing' en 'kerker-vakje'.
	 */
	public static void main(String[] args) {
		//SET-UP: Contructie van kerker, de verschillende vakjes en hun posities.
		Dungeon dungeon = new Dungeon();
		dungeon.setMaximumY(15);
		Square square1 = new Square(new Temperature(new BigDecimal(BigInteger.valueOf(100),0), 
				TemperatureUnit.CELSIUS), new BigDecimal(BigInteger.valueOf(5000),2), 
				Direction.EAST,Direction.SOUTH,Direction.WEST);
		Square square2 = new Square(new Temperature(new BigDecimal(BigInteger.valueOf(100),0), 
				TemperatureUnit.CELSIUS), new BigDecimal(BigInteger.valueOf(5000),2), 
				Direction.NORTH,Direction.WEST);
		Border door = new Door(false);
		square2.buildNewBorderIn(door, Direction.EAST);
		Square square3 = new Square(new Temperature(new BigDecimal(BigInteger.valueOf(-300),1), 
				TemperatureUnit.CELSIUS), new BigDecimal(BigInteger.valueOf(7000),2), 
				Direction.EAST,Direction.SOUTH);
		Square square4 = new Square(new Temperature(new BigDecimal(BigInteger.valueOf(-300),1), 
				TemperatureUnit.CELSIUS), new BigDecimal(BigInteger.valueOf(5000),2), 
				Direction.EAST,Direction.WEST);
		Square square5 = new Square(new Temperature(new BigDecimal(BigInteger.valueOf(900),1), 
				TemperatureUnit.CELSIUS), new BigDecimal(BigInteger.valueOf(2500),2), 
				Direction.NORTH,Direction.SOUTH,Direction.WEST);
		Position position1 = new Position(0, 10, 0);
		Position position2 = new Position(0, 11, 0);
		Position position3 = new Position(1, 11, 0);
		Position position4 = new Position(1, 12, 0);
		Position position5 = new Position(1, 10, 0);
		
		//Stel de vakjes in op hun corresponderende posities in de kerker.
		dungeon.setSquareOnPosition(square1, position1);
		dungeon.setSquareOnPosition(square2, position2);
		dungeon.setSquareOnPosition(square3, position3);
		dungeon.setSquareOnPosition(square4, position4);
		dungeon.setSquareOnPosition(square5, position5);
		System.out.println(position1);
		System.out.println(dungeon.getSquareOnPosition(position1).getClass().getSimpleName() + ": ");
		System.out.println("Temperature: " + dungeon.getSquareOnPosition(position1).getTemperature());
		System.out.println("Humidity: " + dungeon.getSquareOnPosition(position1).getHumidity());
		System.out.println("Roomsize: " + dungeon.getSquareOnPosition(position1).getRoom().size());
		System.out.println();
		
		//Voer interactie uit met de deur.
		door.interact();
		System.out.println("Na openen deur:");
		System.out.println(position1);
		System.out.println(dungeon.getSquareOnPosition(position1).getClass().getSimpleName() + ": ");
		System.out.println("Temperature: " + dungeon.getSquareOnPosition(position1).getTemperature());
		System.out.println("Humidity: " + dungeon.getSquareOnPosition(position1).getHumidity());
		System.out.println("Roomsize: " + dungeon.getSquareOnPosition(position1).getRoom().size());
	}	
}